<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;

class MyController extends Controller
{
    public function getAbout(){
        return 'ABOUT';
    }

    public function index(){
        $data = [
            'name' => '黎明',
            'age' => 50,
            'childname' => '黎小明',
            'childage' => 20
        ];
        return view('myindex',$data);
    }

    public function indexone(){
        $name = '李民';
        return view('myindex',compact('name')); //等于['name' => '李民']
    }

    public function  indexforerch(){
        $people = [
            '张三',
            '李四',
            '王五',
            '赵六'
        ];
        return view('myindex',compact('people'));
    }
}
